package com.cqeec.demo.config;

import com.cqeec.demo.entity.Book;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

@Configuration
public class BookConfig {
    @Bean("loveme")
    @Primary
    public Book loveme() {
        return new Book("霸道总裁爱上我", "言情", 1000);
    }
    @Bean("red")
    public Book book() {
        return new Book("红楼梦", "名著", 2000);
    }
}